Merged
Conversation
Member
leoromanovsky
left a comment
There was a problem hiding this comment.
Is there additional github CI that you can add which will validate this?
Collaborator
Author
@leoromanovsky Great call! I updated with an additional CI check for this specific scenario. |
Collaborator
|
@greghuels have you considered submitting this fix upstream? |
Collaborator
Author
It's probably worth doing this, yes, but I don't want it to hold up existing users. |
dd-oleksii
approved these changes
Jan 13, 2026
Co-authored-by: Oleksii Shmalko <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix C++20 modules compilation on macOS
Fixes #44
Problem
The SDK failed to compile on macOS when C++20 modules were enabled with the
-fmodulesflag. The build produced four compilation errors in the nlohmann JSON library:definition of 'basic_streambuf' must be imported from module 'std.streambuf' before it is required(line 6261)use of undeclared identifier 'errno'(line 8620)use of undeclared identifier 'errno'(line 8630)use of undeclared identifier 'errno'(line 8646)Root Cause
When C++20 modules are enabled, the visibility of standard library includes becomes more restricted. The nlohmann JSON library is a single-header library with includes scattered throughout different sections. Previously, includes from one section were implicitly available in other sections, but with C++20 modules, each section requires explicit includes for the symbols it uses.
Solution
Added two missing standard library includes to
third_party/nlohmann/json.hpp:Added
#include <cerrno>at line 7381 in the lexer sectionerrnomacro is used when parsing numbers in the lexerAdded
#include <streambuf>at line 6162 in the input adapters section<istream>is presentTesting
-fmodulesflag enabledChanges
third_party/nlohmann/json.hpp: Added 2 include statements for C++20 modules compatibility